package study.java.thread08;

import java.util.concurrent.Callable;

/**
* @Name: GetSumCallable
* @Description: Callable<V>接口实现类测试类：整数求和
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-1-10 上午9:36:59 
* @Version: V1.0
 */
public class GetSumCallable implements Callable<Integer>{
	
	private int number ;
	
	public GetSumCallable(int number) {
		this.number = number;
	}

	/**
	* @Name: call
	* @Description: 线程执行方法（socket实现）
	* @Author: 李超	lc_jack@foxmail.com
	* @Version: V1.0
	* @CreateDate: 2017-1-8 下午5:41:40
	* @Parameters: 无
	* @exception Exception	线程执行方法异常	
	* @Return: Integer	返回线程执行结果
	 */
	public Integer call() throws Exception {
		int sum = 0 ;
		for (int i = 0; i <= number; i++) {
			sum += number ;
		}
		return sum;
	}

}
